package com.ava.avamedia.adapter;

import java.util.ArrayList;

import com.ava.avamedia.R;
import com.ava.avamedia.model.PaymentMenu;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class PaymentAdapter extends BaseAdapter {
	Context ctx;
	ArrayList<PaymentMenu> lstPaymentMenu;
	LayoutInflater mInflater;
	public PaymentAdapter(Context ctx, ArrayList<PaymentMenu> lstPaymentMenu) {
		super();
		this.ctx = ctx;
		this.lstPaymentMenu = lstPaymentMenu;
		mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return lstPaymentMenu.size();
	}


	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return lstPaymentMenu.get(arg0);
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.adapter_account, null);
		}
		PaymentMenu menu = (PaymentMenu) getItem(position);
		TextView txtTitle = (TextView) convertView.findViewById(R.id.adapter_account_txt_title);
		TextView txtDesc = (TextView) convertView.findViewById(R.id.adapter_account_txt_desc);
		ImageView imageView = (ImageView) convertView.findViewById(R.id.adapter_account_image_view);
		imageView.setVisibility(View.GONE);
		txtTitle.setText(menu.title);
		txtDesc.setText(menu.desc);
		return convertView;
	}

}
